import {createRouter, createWebHistory} from 'vue-router'


const NotFound = () => import('@/views/error/404.vue')
const Login = () => import('@/views/login.vue')
const HomePage = () => import('@/views/home.vue')
const Main = () => import('@/views/mainpage/moviemain.vue')
const Films = () => import('@/views/mainpage/allfilm.vue')
const Film = () => import('@/views/mainpage/filmdetail.vue')

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    mode: 'history',
    routes: [
        {path: '/:pathMatch(.*)*', component: NotFound},
        {path: '/login', component: Login},
        {
            path: '/', component: HomePage, redirect: '/mainpage',
            children: [
                {path: '/mainpage', component: Main},
                {path: '/films', component: Films},
                {path: '/film/', component: Film}
            ]
        }
    ]
})

export default router
